//
//  UserRegistViewController.m
//  豆瓣
//
//  Created by aaaaaa on 16/6/25.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "UserRegistViewController.h"
#import "LableAndTextFieldView.h"

@interface UserRegistViewController ()

@end

@implementation UserRegistViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    [self config];
 
    [self createSubViews];
}

- (void)config{
    self.navigationItem.title = @"用户注册";
    self.view.backgroundColor = [UIColor whiteColor];
    

    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"注册" style:UIBarButtonItemStyleDone target:self action:@selector(registAction:)];
    
}

- (void)registAction:(UIBarButtonItem *)bar{
    
}

- (void)createSubViews{
    
    NSArray *lableTextArray = @[@"用户名", @"密码", @"确认密码", @"邮箱", @"联系方式"];
    NSArray *textFieldPlaceholder = @[@" 请输入用户名", @" 请输入密码", @" 再输入密码",
                                      @" 请输入邮箱", @" 请输入联系方式"];
    for (int i = 0; i < 5; i++) {
        LableAndTextFieldView *ltView = [[LableAndTextFieldView alloc] initWithFrame:CGRectMake(30, 64 + 40 + (35 + 15)* i, self.view.bounds.size.width - 60, 35)];
        ltView.lableText = lableTextArray[i];
        ltView.textFieldPlaceholder = textFieldPlaceholder[i];
        
        if (i == 1 || i == 2) {
            ltView.encryption = YES;
        }
        
        [self.view addSubview:ltView];
        [ltView release];
    }
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
